package com.etonenet.base.repository;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.etonenet.base.entity.Group;

public interface GroupRepository extends BaseRepository<Group, Integer> {
	
	@Transactional
	@Modifying
	public void deleteByGroupName(String groupName);

	@Query(nativeQuery = true, value = "udpate groups set group_name=?2 where group_name = ?1")
	@Modifying
	public void rename(String oldName, String newName);

}
